﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="porderlist.aspx.cs" Inherits="UI.system.page.porder.porderlist" %>
<%@ Import Namespace="Model" %>
<%@ Import Namespace="DAL" %>
<%@ Import Namespace="Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/md5.js"></script>
    <script src="/js/swfupload.js"></script>
    <script src="/system/js/admin.js"></script>
    <script src="/system/layui/layui.js"></script>
    <link rel="stylesheet" href="/system/layui/css/layui.css">
    <link rel="stylesheet" href="/system/css/iframe.css">
    <style>
        td img{width:40px; height:30px; float:left; object-fit:cover}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="layer-toolbar">
        <div class="layer-toolbar-left">
        <%=MenuDAL.Power("Save") %>
        </div>
        <div class="layer-toolbar-right">
            <input id="keyword" type="text" name="title" placeholder="标题" autocomplete="off" class="layui-input" value=""  style="width:150px;" onkeyup='CRM.Enter("#search")'>
            <a id="search" class="layui-btn layui-btn-small layui-btn-normal" onclick="Search()">搜索</a>
            <a class="layui-btn layui-btn-small" onclick="Search()">刷新</a>
        </div>
    </div>
    <div id="iframe" class="layer-iframe">
    <table class="layui-table" lay-data="{id:'mytable', page:true, loading:true, height:'full-90'}">
      <thead>
        <tr>
          <th lay-data="{width:150, field:'Num'}">单号</th>
          <th lay-data="{width:90,field:'RealName'}">真实姓名</th>
          <th lay-data="{width:120, field:'Mobile'}">手机号</th>
          <th lay-data="{width:90, templet:'<div><font class=\'green\'>{{d.Money.toFixed(2)}}</font></div>'}">商品金额</th>
          <th lay-data="{width:90, templet:'<div><font class=\'green\'>{{d.PostMoney.toFixed(2)}}</font></div>'}">快递费用</th>
          <th lay-data="{width:100,templet:'<div><font class=\'red\'>{{d.QuanMoney.toFixed(2)}}</font></div>'}">优惠券抵扣</th>
          <th lay-data="{width:90,templet:'<div><font class=\'red\'>{{d.ScoreMoney.toFixed(2)}}</font></div>'}">积分抵扣</th>
          <th lay-data="{width:90,templet:'<div><font class=\'green\'>{{d.AllMoney.toFixed(2)}}</font></div>'}">实付金额</th>
          <th lay-data="{width:90, templet:'<div><font class={{d.State==4?\'green\':\'red\'}}>{{d.StateText}}</font></div>'}">订单状态</th>
          <th lay-data="{width:90, field:'Logistics'}">快递公司</th>
          <th lay-data="{width:130, field:'ExpressNum'}">快递单号</th>
          <th lay-data="{width:80, field:'Province'}">省</th>
          <th lay-data="{width:80, field:'City'}">市</th>
          <th lay-data="{width:80, field:'Area'}">区</th>
          <th lay-data="{width:400, field:'Address'}">收货地址</th>
          <th lay-data="{width:90, field:'Count'}">商品数量</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">付款时间</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">发货时间</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">收货时间</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">退货时间</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">提醒发货时间</th>
          <th lay-data="{width:150,templet:'<div>{{d.CreateDate.ToTime()}}</div>'}">创建时间</th>
          <th lay-data="{width:145, fixed:'right', toolbar:'#handler'}">操作</th>
        </tr>
      </thead>
    </table>
    <script type="text/html" id="handler">
      <%=MenuDAL.Power("") %>
    </script>
    </div>
    </form>
    <script>
        layui.use(["form", "table"], function () {
            var $ = layui.jquery, form = layui.form;
            table = layui.table;
            Init_Pager();
        });
        function Init_Pager() {
            var data = {};
            data.act = "Find_POrder";
            data.begindate = $("#begindate").val();
            data.enddate = $("#enddate").val();
            data.keyword = $("#keyword").val();
            data.sign = GetSign(data.act);
            table.reload('mytable', {
                url: '/tools/Admin.ashx',
                loading: true,
                where: data
            });
        };
        
        function Delete(o, id) {
            LayerBox.Confirm("您确定要删除吗？", function () {
                Delete_Table(o, id, "Delete_POrder");
            });
        };

        function Send(o, id) {
            LayerBox.Loading();
            Ajax.Get("/system/page/porder/sendporder.aspx?id=" + id + "&v=" + Math.random(), function (html) {
                LayerBox.Close.ByAll();
                window.parent.LayerBox.Show("发货", html, "400px", "450px", null, function (form) {
                    var data = form;
                    data.act = "Send_POrder";
                    data.id = id;
                    data.sign = GetSign(data.act);
                    LayerBox.Loading();
                    Ajax.Post("/tools/Admin.ashx", data, function (r) {
                        var json = $.parseJSON(r);
                        if (json.state) {
                            LayerBox.Success(json.msg, 500, function () {
                                LayerBox.Close.ByAll();
                                $(".layui-laypage-btn").click();
                            });
                        }
                        else {
                            LayerBox.Error(json.msg);
                        }
                    });
                });
                window.parent.UE.delEditor('context');
                var ue = window.parent.UE.getEditor('context');
            });
        };
</script>
</body>
</html>
